package com.xywl.escort.adapter;

import android.support.annotation.Nullable;
import android.support.v4.content.ContextCompat;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.xywl.escort.R;
import com.xywl.escort.bean.SpecificResp;

import java.util.List;

public class SpecificListAdapter extends BaseQuickAdapter<SpecificResp.Specific, BaseViewHolder> {
    public SpecificListAdapter(int layoutResId, @Nullable List<SpecificResp.Specific> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, SpecificResp.Specific item) {
        helper.setText(R.id.text_name, item.value);
        if (item.isClick) {
            helper.setTextColor(R.id.text_name, ContextCompat.getColor(mContext, R.color.normal_text_color));
            helper.setBackgroundRes(R.id.text_name, R.drawable.shape_corner_hollow_blue);
        } else {
            helper.setTextColor(R.id.text_name, ContextCompat.getColor(mContext, R.color.main_body_prompt_color));
            helper.setBackgroundRes(R.id.text_name, R.drawable.shape_corner_hollow_gray);
        }
    }
}
